@extends('admin::layouts.master')
@section('content')
    <div class="col-lg-12">
        <div class="card card-border-color card-border-color-success">
            <div class="card-header">
                货品操作>>>>【{{$goods['gname']}}的货品】
            </div>
            <div class="card-body">
                <div class="col-lg-12">
                    <div class="card card-table">
                        <div class="card-header">
                            <a href="{{route('goods.index')}}" class="btn btn-space btn-danger">查看商品列表</a>
                            <a href="{{route('shop',$gid)}}" class="btn btn-space btn-primary">货品列表</a>
                            <a href="" class="btn btn-space btn-success">添加货品</a>
                        </div>
                        <div class="card-body">
                            <div class="col-lg-12">
                                <div class="card card-border-color card-border-color-warning">
                                    <div class="card-header card-header-divider">添加货品<span class="card-subtitle" style="color: dimgrey;">请在下面选择货品的样式</span></div>
                                    <div class="card-body">
                                        <form action="{{route('shopstore',$goods['id'])}}" method="post">
                                            @csrf
                                            <div class="form-group">
                                                <label>货品名称</label>
                                                <input type="text" name="sname" placeholder="请输入货品名称" class="form-control">
                                            </div>
                                            <div class="form-group">
                                                <label>货品价格</label>
                                                <input type="number" name="price" placeholder="请输入货品价格" class="form-control">
                                            </div>
                                            @foreach($topAttrs as $v)
                                            <div class="form-group">
                                                <label> {{$v['aname']}} </label>

                                                <select name="attrs[]"  class="form-control">
                                                <option value="">请选择{{$v['aname']}}</option>
                                                @foreach($v['son'] as $vv)
                                                    <option value="{{$vv['aname']}}">{{$vv['aname']}}</option>
                                                @endforeach
                                                </select>

                                            </div>
                                            @endforeach

                                            <div class="form-group">
                                                <label>货品库存</label>
                                                <input type="text" name="kucun" placeholder="请输入货品库存" class="form-control">
                                            </div>

                                            <div class="row pt-0 pt-sm-5">
                                                <div class="col-sm-6 pl-0">
                                                    <p class="text-right">
                                                        <button type="submit" class="btn btn-space btn-primary">添加货品</button>
                                                    </p>
                                                </div>
                                            </div>
                                        </form>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    @endsection